package 笔试.吉比特.杂项;

public class Main {
    public static int gbits(int n) {
        int count = 0;
        while (n > 0) {
            n = n & (n - 1);
            count++;
        }
        return count;
    }

    public static void main(String[] args) {
        System.out.println(gbits(2023));
        System.out.println(Integer.toBinaryString(2023));
    }
}
